* {
  scroll-behavior: smooth;
}

@import url(https://fonts.googleapis.com/css?family=Montserrat);

@supports (height: 100vh) {
  body {
    background: linear-gradient(to right top, #0089f2 50%, #ddd 50%);
    background-size: 100% calc(100% - 100vh + 5px);
    background-repeat: no-repeat;
  }

  body:before {
    content: '';
    position: fixed;
    top: 128px;
    bottom: 0;
    width: 100%;
    z-index: -1;
    background: white;
  }
}

// 进度条指示器
#scroll-line {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: blue;
  width: 0%;
}
// 侧边 按钮
#page-button {
  position: fixed;
  top: 50%;
  right: 40px;
  transform: translateY(-50%);
  background-color: #ffcc00;
  width: 30px;
  height: 200px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  text-align: center;
  .button-wrapper a {
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    line-height: 24px;
  }
}

header {
  overflow: hidden;
  padding-bottom: 55%;
  @media (min-width: 600px) {
    padding-bottom: 50%;
  }

  @media (min-width: 700px) {
    padding-bottom: 45%;
  }

  img {
    width: 100%;
    max-width: none;
    position: fixed;
    top: 0%;
    left: 50%;
    transform: translateX(-50%);
  }
}

.transition(@time; @property: all; @easing: ease-in) {
  transition: @property @time @easing;
}
.flex(@justify: center; @align: center; @direction: row) {
  display: flex;
  flex-direction: @direction;
  align-items: @align;
  justify-content: @justify;
}

@parallax-offset: 30vh;
@content-offset: 40vh;
@transition-speed: 1.2s;
@slide-number: 6;

.loop(@all, @index: 1) when (@index <= @all + 1) {
  .loop(@all, @index + 1);
  .section:nth-child(@{index}) {
    z-index: (@all + 1) - @index;
  }
}

#main {
  position: relative;
  overflow: hidden;
  z-index: 99;

  .loop(@slide-number, 1);
  .section {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    overflow: hidden;
    will-change: transform;
    backface-visibility: hidden;
    background-color: #fcfcfc;
    height: 100vh + @parallax-offset;
    position: fixed;
    width: 100%;
    transform: translateY(@parallax-offset);
    text-align: center;
    .transition(@transition-speed, all, cubic-bezier(0.22, 0.44, 0, 1));
    &:before {
      content: '';
      position: absolute;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.3);
    }
    &:first-child {
      background-image: url(https://i.postimg.cc/kXq9Qmnj/bgd1.jpg);
      transform: translateY(-@parallax-offset / 2);
      .content-wrapper {
        transform: translateY(@parallax-offset / 2);
      }
    }
    &:nth-child(2) {
      background-image: url(https://i.postimg.cc/W14vywqg/photo-1424746219973-8fe3bd07d8e3.jpg);
    }
    &:nth-child(3) {
      background-image: url(https://i.postimg.cc/TY0xQ41T/photo-1433840496881-cbd845929862.jpg);
    }
    &:nth-child(4) {
      background-image: url(../image/city.jpg);
    }

    &:nth-child(5) {
      background-image: repeating-linear-gradient(
        to right,
        #91706885 0px,
        white 176px,
        #a67676 223px
      );
    }
    &:nth-child(6) {
      background-image: linear-gradient(to bottom, #ff00004a, #0000ff8f);
    }

    // content
    .content {
      &-wrapper {
        position: relative;
        height: 100vh;
        display: flex;
        justify-content: center;
        text-align: center;
        flex-flow: column nowrap;
        align-items: center;
        color: #fff;
        font-family: Montserrat;
        // text-transform: uppercase;
        transform: translateY(@content-offset);
        will-change: transform;
        backface-visibility: hidden;
        .transition(
          @transition-speed + 0.5,
          all,
          cubic-bezier(0.22, 0.44, 0, 1)
        );
      }
      &-title {
        position: absolute;
        left: 20%;
        right: 20%;
        top: 11%;
        letter-spacing: 10px;
        font-size: 24px;
        line-height: 1.4;
      }

      &-avatar {
        overflow: hidden;
        width: 150px;
        height: 150px;
        margin-top: -60px;
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
        border: 5px solid #fff;
        .flex();
        img {
          width: 100%;
        }
      }

      &-motto {
        margin-bottom: 60px;
        font-size: 32px;
        color: #fff;
        padding: 64px 160px 30px;
        box-sizing: border-box;
        border-bottom: 1px solid rgba(0, 0, 0, 0.23);
      }

      &-description {
        color: #c0bebe;
        line-height: 30px;
        font-size: 16px;
        vertical-align: top;
      }

      &-info-list {
        .flex(space-around);
        min-width: 880px;
        margin-top: -180px;
        font-size: 18px;
        li {
          .flex(space-between, center, column);
          height: 100px;
          .icon {
            width: 90px;
            height: 90px;
            border-radius: 50%;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12),
              0 0 6px rgba(0, 0, 0, 0.04);
            line-height: 90px;
            cursor: pointer;
            background-color: rgba(255, 255, 255, 0.12);
          }
          .desc {
            margin-top: 20px;
            color: #fff;
            letter-spacing: 2px;
          }
        }
      }

      &-detail {
        padding-top: 100px;
        line-height: 40px;
        letter-spacing: 2px;
        font-size: 17px;
      }

      &-skills {
        .flex(center, center, column);
        overflow: hidden;
        width: 100%;
        max-width: 1300px;

        .skill-wrapper {
          width: 80%;
          .flex(space-around);
          flex-wrap: wrap;

          li {
            overflow: hidden;
            position: relative;
            margin: 40px 20px;
            width: 150px;
            height: 150px;
            background-image: linear-gradient(180deg, #282525, #615252);
            border-radius: 50%;
            box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
            border: 1px solid hsla(0, 15%, 30%, 0.3);
            transition: all 0.2s ease;
            .flex();

            img {
              max-height: 80px;
            }

            &:nth-child(1) {
              img {
                position: relative;
                top: -13px;
                left: -10px;
                max-height: 100px;
              }
            }
            &:nth-child(2) {
              background-image: linear-gradient(
                rgb(140, 207, 0),
                rgb(128, 189, 1)
              );
              border-color: rgb(140, 207, 0);
            }

            &:nth-child(3) {
              background-image: linear-gradient(#20232a, #333333);
              border-color: #2c2020a8;
            }
            &:nth-child(4) {
              background-image: linear-gradient(180deg, #90a4ae, #5e35b1c4);
              border-color: #8b95cd85;
            }
            &:nth-child(5) {
              background-image: linear-gradient(180deg, #ffffff, #ffffff);
              // border-color: rgb(138, 141, 120);
            }

            &:nth-child(6) {
              background-image: linear-gradient(180deg, #ffeb3bde, #97cdbe);
              border-color: #c8d197;
            }
            &:nth-child(7) {
              background-image: linear-gradient(180deg, #26a69a, #97cdbe);
              border-color: #2acdc0a3;
            }

            &:nth-child(8) {
              background-image: linear-gradient(180deg, #f8bbd0, #f06292);
              border-color: #f8bbd06e;
            }
          }
        }
      }

      &-history {
        width: 100%;
        max-width: 750px;

        .mycard {
          overflow: hidden;
          position: relative;
          width: 100%;
          height: 350px;
          background-color: #151515f2;
          border: 1px solid #3d3c3c;
          border-radius: 10px;
          box-shadow: 0 0 25px rgba(142, 142, 142, 0.33);
          color: #ffffff;
          transform-style: preserve-3d;
          transform-origin: center;
          transition: transform 0.3s linear;

          &:hover {
            transform: rotateY(6.8deg) rotateX(-3deg);
          }

          & > li:not(:first-child) {
            // opacity: 0;
            display: none;
          }

          & > li {
            position: absolute;
            box-sizing: border-box;
            padding: 30px 150px;
            text-align: left;
            .title {
              color: goldenrod;
              font-size: 18px;
              font-weight: bold;
              line-height: 40px;
            }

            .timeline {
              margin-top: 10px;
              font-size: 14px;
            }
            .job,
            .timeline {
              color: gold;
              line-height: 30px;
            }

            .duty {
              margin-top: 5px;
              li {
                line-height: 40px;
                font-size: 17px;
              }
            }
          }
        }

        .dot {
          margin: auto;
          padding: 20px 0;
          width: 50%;
          line-height: 40px;
          .flex(space-around);
          li {
            width: 15px;
            height: 15px;
            border-radius: 50%;
            background-color: #4f4d4dad;
            &.active {
              background-color: #827717;
            }
          }
        }

        .aside {
          overflow: hidden;
          margin-top: 20px;
          line-height: 30px;
          width: 500px;
          white-space: nowrap;
          text-overflow: ellipsis;
        }
      }

      &-opus {
        max-width: 1220px;
        min-width: 880px;
        width: 80%;
        color: #000000;
        .flex(space-around);
        flex-wrap: wrap;

        dl {
          position: relative;
          flex-basis: 45%;
          margin-bottom: 20px;
          padding-bottom: 24%;
          height: 0;
          overflow: hidden;
          background: #fefefe;
          border: 1px solid #eee;
          border-radius: 6px;
          box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
          text-align: left;

          & > * {
            padding-left: 12px;
            letter-spacing: 1px;
          }

          .title {
            padding-top: 20px;
            line-height: 22px;
            font-weight: bold;
            font-size: 18px;
            color: #ad1457;
          }

          .desc {
            margin-top: 20px;
            margin-right: 30px;
            margin-bottom: 20px;
            line-height: 24px;
            color: #222222;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
          }

          .link {
            position: absolute;
            bottom: 20px;
            left: 30px;
            width: 200px;
            height: 40px;
            border: 1px solid #eee;
            border-radius: 6px;
            color: #dddddd;
            line-height: 40px;
            text-align: center;
          }
        }
      }

      &-subtitle {
        line-height: 60px;
        font-size: 18px;
        color: #fcfcfc;
        padding-left: 20px;
      }

      &-form {
        max-width: 700px;
        width: 100%;
        padding-right: 20px;
        text-align: left;
        height: 600px;
        background-color: rgba(0, 0, 0, 0.12);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
        color: #69606b;

        & > div {
          padding: 40px 0 0 40px;
          input {
            width: 100%;
            padding: 0.75em;
            border-radius: 5px;
            border: 1px solid #ddd;
            background-color: rgba(255, 255, 255, 0.8);
            line-height: 1.5;
            font-size: 20px;
            transition: background-color 0.5s;
            box-sizing: border-box;
            &:focus {
              background-color: rgba(255, 255, 255, 0.5);
            }
          }
        }

        .line1 {
          padding: 40px 0 0 40px;
          width: 450px;
        }

        .line3 {
          .flex(space-between);
          input {
            width: 48%;
          }
        }

        .submit {
          text-align: center;
          button {
            overflow: hidden;
            width: 80px;
            border-radius: 50%;
            line-height: 80px;
            cursor: pointer;
            outline: none;
            &:hover {
              background-color: rgba(255, 255, 255, 0.95);
            }
          }
        }
      }
    }
  }
}

#app #main .background.up-scroll {
  transform: translate3d(0, -@parallax-offset / 2, 0);
  .content-wrapper {
    transform: translateY(@parallax-offset / 2);
  }
  + .background {
    transform: translate3d(0, @parallax-offset, 0);
    .content-wrapper {
      transform: translateY(@parallax-offset);
    }
  }
}

#app #main .background.down-scroll {
  transform: translate3d(0, -(100vh + @parallax-offset), 0);
  .content-wrapper {
    transform: translateY(@content-offset);
  }
  + .background:not(.down-scroll) {
    transform: translate3d(0, -@parallax-offset / 2, 0);
    .content-wrapper {
      transform: translateY(@parallax-offset / 2);
    }
  }
}
